/******************************************************************************
 cnome: A C++ source "genes" discover. :-)

 See more details at:

   http://www.codeplex.com/cnome

 The original author site is at: http://www.alexandre-barbosa.com/

 Copyright (c) 2008 Alexandre Barbosa.
 Distributed under the MIT License. (See accompanying file LICENSE-MIT.txt 
 or at http://www.codeplex.com/cnome/license)
 ******************************************************************************/

#ifndef VARIABLES_H
#define VARIABLES_H

#include "cnome_typedefs.h"

namespace cnome {

    struct var
    {
        static scopeT     scope;
        static lstScopeT  l_scope;
        static lstScopeT  l_typeDecl;
        static scopeT     typeDecl;
        static prmsT      prms;
        static lstprmsT   l_prms;
		static prmPNumsT  prmNums;
		static int        prmLevel;
        static prmsT      prmVars;
        static lstprmsT   l_prmVars;
        static prmsT      tmplPrms;
        static prmPNumsT  tmplPrmNums;
		static int        tmplPrmLevel;
        static lstprmsT   l_tmplPrms;
        static prmsT      tmplPrmVars;
        static lstprmsT   l_tmplPrmVars;
		static lstItSblsT l_usgDrts; // List of using directives
        static symbolItemPtr mthScope;
        static lstTdc     l_tdc;
        static scopeT     dcl_spc;
        static lstScopeT  l_dcl_spc;
        static symbolItemPtr tmplSbl;
		static bool       isScopeAbsolut;
		static std::size_t scopeSuffixSize;
		static lstSizesT   l_scopeSuffixSize;
		static eParameterType parameterType;
    };

    class sglLookahead
    {
    public:
        static sglLookahead* instance()
        {
            if (!m_sgl)
                m_sgl = new sglLookahead;

            return m_sgl;
        }

		bool get_is_looking() { return m_isLooking>0; }

		void set_is_looking(bool is)
        {
            if (is)
                m_isLooking++;
            else 
                m_isLooking--;
        }

	private:
        static sglLookahead* m_sgl;
        int m_isLooking;
        sglLookahead() : m_isLooking(0) {}
    };

} // namespace cnome {

#endif // VARIABLES_H
